﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Management;
using System.Text;

namespace WMI.NET.CIM
{
    /// <summary>
    /// The CIM_PointingDevice class represents a device that points to regions on the display. Any device that manipulates a pointer, or points to regions on a visual display, is a member of this class. For example, a mouse, stylus, touch pad, or tablet.
    /// </summary>
    public class CIM_PointingDevice : CIM_UserDevice
    {

        private Nullable<UInt16> _Handedness;
        private Nullable<Byte> _NumberOfButtons;
        private Nullable<UInt16> _PointingType;
        private Nullable<UInt32> _Resolution;

        /// <summary>
        /// Configuration of the pointing device for right-hand or left-hand operation. 
        /// </summary>
        public Nullable<UInt16> Handedness { get { return _Handedness; } } //TODO enum

        /// <summary>
        /// Number of buttons on the pointing device.
        /// Example: "2"
        /// </summary>
        public Nullable<Byte> NumberOfButtons { get { return _NumberOfButtons; } }

        /// <summary>
        /// Type of the pointing device.
        /// </summary>
        public Nullable<UInt16> PointingType { get { return _PointingType; } } //TODO enum

        /// <summary>
        /// Tracking resolution.
        /// Example: "0"
        /// </summary>
        public Nullable<UInt32> Resolution { get { return _Resolution; } }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="mbo"></param>
        public CIM_PointingDevice(ManagementBaseObject mbo)
            : base(mbo)
        {
            _Handedness = mbo.GetUshortValue("Handedness");
            _NumberOfButtons = mbo.GetByteValue("NumberOfButtons");
            _PointingType = mbo.GetUshortValue("PointingType");
            _Resolution = mbo.GetUIntValue("Resolution");
        }

    }
}
